import React, {memo} from 'react';
import {RoomsWrapper} from '@/components/section-rooms/style'
import * as propTypes from 'prop-types'
import RoomItem from '@/components/room-item'

const SectionRooms = memo((props) => {
    const {roomList = [], itemWidth} = props;

    return (
        <RoomsWrapper>
            {
                roomList.slice(0, 8)?.map(item => {
                    return <RoomItem key={item.id} itemData={item} itemWidth={itemWidth}></RoomItem>
                })
            }

        </RoomsWrapper>
    );
});

SectionRooms.propTypes = {
    roomList: propTypes.array
}

export default SectionRooms;
